<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateTableArticleArchieves extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('article_archieves', function (Blueprint $table) {
            //
            $table->increments('id');
            $table->integer('user_id')->unsigned()->default(0)->index();
            $table->string('article_ids')->default('')->comment('该月的所有文章ID,以短横-分隔');
            $table->integer('article_count')->default(0)->comment('该月的文章数');
            $table->string('archieved_at')->default('')->index()->comment('归档的年月');

            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('article_archieves');
    }
}
